PowerShell hygiene burndown (#530)#531
Draft
PolyphonyRequiem wants to merge 1 commit into
Draft
Conversation
- Invoke-PolyphonySdlc.ps1:833: replaced last surviving `git -C` with cwd-scoped invocation (Push-Location/Pop-Location) - Invoke-PolyphonySdlc.ps1:357,424-456: sanitized $Comment against newline + backtick injection in the reset path via Get-SanitizedComment - worktree-manager.ps1:254-272: backported retry-with-backoff from src/Polyphony/Journal/Reset/Deleters/GitWorktreeDeleter.cs:37-64 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PowerShell hygiene burndown — issue #530
Implements all three fixes from #530.
Fix 1 —
git -Cremoval (Invoke-PolyphonySdlc.ps1:833)Replaced the last surviving
git -C $mainWorktree remote get-url originwith aPush-Location/Pop-Location-scoped invocation. Matches the cwd-scoped pattern used everywhere else in the launcher.Fix 2 —
$Commentsanitization (Invoke-PolyphonySdlc.ps1:357, 424-456)Added
Get-SanitizedCommenthelper near the top of the script that strips CR/LF characters and escapes backticks. Applied at the reset-path boundary (immediately after the incompatible-param guard) so all downstream uses — including$resetArgsand the here-string passed topwsh -Command— receive the sanitized value. Prevents newline injection and backtick injection.Fix 3 — Retry-with-backoff in worktree teardown (worktree-manager.ps1:254-272)
Backported the delay schedule from
GitWorktreeDeleter.cs:RemoveWithRetryAsync(0 ms → 200 ms → 500 ms → 1 000 ms, 4 attempts). Includes the same "already gone = success" short-circuit. Tolerates transient file-handle races on Windows during worktree deletion.Testing
.ps1files via[System.Management.Automation.Language.Parser]::ParseFile— 0 errors in each..conductor/registry/tests/lint-polyphony.Tests.ps1— 29/29 tests passed.Invoke-PolyphonySdlc.ps1or the teardown retry path; tested via AST parse only for those surfaces.Closes #530